<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@page import="com.is.util.ParamUtil"%>
<%@page import="java.util.ArrayList"%>
<%@page import="com.is.control.UserControl" %>
<%@page import="com.is.model.User" %>
<%@page import="java.util.List" %>
<%
	request.setCharacterEncoding("UTF-8");
	String name = ParamUtil.getString(request,"userName");
	String resultName = "";
	List<User> list = new ArrayList<User>();
	Boolean flag = false;
	list = UserControl.getAllUsersByRole("");
	for(int i=0;i<list.size();i++){
		resultName = list.get(i).getUsername();
		if(!name.equals("") && resultName.equals(name)){
			//System.out.println("用户名已存在");
			flag = true;
		} else{
			resultName = "";
		}
	}
	if(!flag){
		out.print("用户名可以用");
	} else{
		out.println("用户名已存在");
	}
%>